package com.ww.springboot.boot.test;

import cn.hutool.json.JSONUtil;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 描述：
 *
 * @author wanwei
 * @since 2021-06-30 10:11
 */
public class RetryTest2 {

    public static void main(String[] args) throws UnsupportedEncodingException {
        String ids = "1501859368314130433";

        List<String> typeList = new ArrayList<>();
        typeList.add("generate_label_queue");
//        typeList.add("callBack_trackNo_queue");
//        typeList.add("callBack_label_queue");

        for(String type :typeList){
            List<String> list = Arrays.asList(ids.split(","));
            List<ForecastLogDTO> dtos = new ArrayList<>();
            for (String id : list) {
                ForecastLogDTO forecastLogDTO = new ForecastLogDTO();
                forecastLogDTO.setBizType(1);
                forecastLogDTO.setConsumerQueue(type);
                forecastLogDTO.setMqMessage("{\"id\":" + id + "}");
                dtos.add(forecastLogDTO);
            }
            String msg = JSONUtil.toJsonStr(dtos);
            System.out.println(msg);
        }
    }
}
